<%@ page contentType="text/html; charset=UTF-8" language="java" import="java.util.*,org.yoao.crm.bean.Role,org.yoao.crm.bean.Company"%>
<%
   	String base = request.getContextPath();
   	List roleList = (List)request.getAttribute("ROLECHILDS");
	List companyList = (List)request.getAttribute("COMPANY");
	String info = (String)request.getAttribute("Message");
%>   	
<html>
<head>
<title>用户注册</title>
<link href="<%=base%>/regedit/regstyle.css" rel="stylesheet" type="text/css">
<script src="<%=base%>/regedit/validator.js"></script>
<script src="<%=base%>/regedit/publicEvent.js"></script>
<script language="javascript">
function checkData(obj){
	if(!Validator.Validate(obj,3))return false;
	return true;
}
</script>
</head>
<base target="_self"/>
<body topmargin="0" leftmargin="0" class="dialog" onLoad="public_onload();">
<form name="form1" method="post" action="<%=base%>/regedit?method=regedit" onSubmit="return checkData(this);">
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="maintable">
	  <tr valign="top" class="tree_title_txt">
			<td class="tree_title_txt" height=26 align=center valign="middle">用户注册</td>
	  </tr>
	</table>
	<center>	
	<div class="tabBody">
	 	<table width=98% align="center" width="100%" border="0" cellspacing="0" cellpadding="0" class="maintab_content_table">
       		<tr>
       			<td class="Form_BBS_Lable" width=160 width="14%" valign="middle">&nbsp;&nbsp;用户名</td>
       			<td class="Form_BBS_td" width="86%" valign="middle">
       				<input name="userName" type="text" class="text_220" style="width:250px" size="25" maxB="25" Require="true">&nbsp;<span class="biTian">*&nbsp;注册后不可修改,勿含中文.</span>
       			</td>
       		</tr><tr>	
       			<td class="Form_BBS_Lable" width=160 width="14%" valign="middle">&nbsp;&nbsp;昵称</td>
       			<td class="Form_BBS_td" width="86%" valign="middle">
       				<input name="nickName" type="text" class="text_220" style="width:250px" size="25" maxB="25" Require="true">&nbsp;<span class="biTian">*</span>
       			</td>
       		</tr>
       		<tr>
       			<td class="Form_BBS_Lable" width=160 width="14%" valign="middle">&nbsp;&nbsp;密码</td>
       			<td class="Form_BBS_td" width="86%" valign="middle">
       				<input name="passWord" type="password" class="text_220" style="width:250px" size="25" maxB="25" Require="true">&nbsp;<span class="biTian">*</span>
       			</td>
       		</tr><tr>	
       			<td class="Form_BBS_Lable" width=160 width="14%" valign="middle">&nbsp;&nbsp;角色</td>
       			<td class="Form_BBS_td" width="86%" valign="middle">
       				<select name="role" class="text_220" style="width:250px" Require="true">
       					<option value="">
       				<%
        					if(roleList != null){
        						for(int i=0;i<roleList.size();i++){
        							Map map = (Map)roleList.get(i);
		%>
						<option value="<%=map.get("ROLEID")%>"><%=map.get("ROLENAME")%>
		<%	            							
        						}
        					}
        			%>
       				</select>&nbsp;<span class="biTian">*</span>
       			</td>
       		</tr>
       		<tr>
       			<td class="Form_BBS_Lable" width=160 width="14%" valign="middle">&nbsp;&nbsp;联系电话</td>
       			<td class="Form_BBS_td" width="86%" valign="middle">
       				<input name="phone" type="text" class="text_220" style="width:250px" size="25" maxB="25" dataType="Mobile" Require="true">&nbsp;<span class="biTian">*</span>
       			</td>
       		</tr>
       		<tr>	
       			<td class="Form_BBS_Lable" width=160 width="14%" valign="middle">&nbsp;&nbsp;地址</td>
       			<td class="Form_BBS_td" width="86%" valign="middle">
       				<input name="address" type="text" class="text_220" style="width:250px" size="25" maxB="25">
       			</td>
       		</tr>
       		<tr>
       			<td class="Form_BBS_Lable" width=160 width="14%" valign="middle">&nbsp;&nbsp;公司名称</td>
       			<td class="Form_BBS_td" width="86%" valign="middle">
       				<select name="companyId" class="text_220" style="width:250px" Require="true">
       					<option value="">
       			<%
       					if(companyList != null){
       						for(int i=0;i<companyList.size();i++){
       							Company company = (Company)companyList.get(i);
	%>
					<option value="<%=company.getCompanyId()%>"><%=company.getCompanyName()%>
	<%	            							
       						}
       					}
       			%>
       				</select>&nbsp;<span class="biTian">*</span>
       			</td>
       		</tr>
       		<tr>	
       			<td class="Form_BBS_Lable" width=160 width="14%" valign="middle">&nbsp;&nbsp;职务</td>
       			<td class="Form_BBS_td" width="86%" valign="middle">
       				<input name="position" type="text" class="text_220" style="width:250px" size="25" maxB="25">
       			</td>
       		</tr>        		
       	</table>
       	</div>
	</center>

 <div style="margin:12px">	 
 	<table width=96% align=center border="0" cellspacing="0" cellpadding="0" style="margin-top:-6px">
		<tr>
			<td width="65%" align="right" valign="center"><div id="myLoad" style="text-align:left"></div></td>
			<td width="35%" align="right" valign="center">
				<input type="submit" style="margin-right:8px" class="btn3_mouseout" value="保存" /> 
				<input type="button" onClick="self.close();" class="btn3_mouseout" value="关闭"/>
			</td>				
		</tr>
	</table>
<%
	if(info != null && info.trim().length()>0){
%>
		<script type="text/javascript">
			document.getElementById("myLoad").innerHTML = "<img src='<%=base%>/images/info.gif' alt='数据保存信息' class='icon1' border='0' align='absmiddle'/> <%=info%>";
		</script>
<%	
	} 
%> 
 </div>
</form>
</body>
</html>